<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>节点函数</title>
	<!--百度jQueryCDN-->
	<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
	<script>
		$(document).ready(function() {
			//append
			$("#btn1").click(function() {
				$("div").append('<p>Hello World!</p>');
			});

			//appendTo
			$("#btn2").click(function() {
				$("<p>Hello World!</p>").appendTo($("div"));
			});

			//before
			$("#btn3").click(function() {
				$("div").before("<div>before</div>");
			});

			//after
			$("#btn4").click(function() {
				$("div").after("<div>after</div>");
			});

			//empty
			$("#btn5").click(function() {
				$("p").empty();
			});

			//remove
			$("#btn6").click(function() {
				$("p").remove();
			});

			//wrap
			$("#btn7").click(function() {
				$("p").wrap('<div></div>');
			});

			//unwrap
			$("#btn8").click(function() {
				$("p").unwrap('<div></div>');
			});
		});
	</script>
	<style>
		* {
			margin: 0;
			padding: 0;
		}

		div {
			width: 100%;
			height: 100px;
			background-color: red;
			margin-bottom: 20px;
		}
	</style>
</head>
<body>
	<div></div>
	<p>Test empty() remove()</p>
	<button id="btn1">append</button>
	<button id="btn2">appendTo</button>
	<button id="btn3">before</button>
	<button id="btn4">after</button>
	<button id="btn5">empty</button>
	<button id="btn6">remove</button>
	<button id="btn7">wrap</button>
	<button id="btn8">unwrap</button>
</body>
</html>